package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.common.core.domain.entity.SysUser;
import com.zzyl.nursing.domain.NursingElder;
import com.zzyl.nursing.vo.NursingNameVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * 护理员老人关联Mapper接口
 *
 * @author ruoyi
 * @date 2024-05-28
 */
@Mapper
public interface NursingElderMapper extends BaseMapper<NursingElder> {


    List<NursingNameVo> selectNickNameByElderId(@Param("set") Set<Long> elderIds);

    @Select("select su.user_id as userId,su.nick_name  from nursing_elder ne,sys_user su where ne.elder_id=#{elderId} and su.user_id=ne.nursing_id and su.status=0")
    List<SysUser> selectUserByElderId(Long elderId);
}
